package file;
import java.io.File;
/**
 * 查看一个文件目录下的所有文件
 */
public class Demo04 {
    public static void main(String[] args) {
      showFile("E:\\");
    }
    public static void showFile(String pathname){
        File file = new File(pathname);
        boolean flag = file.isDirectory();
        if (flag){
            File[] files = file.listFiles();
            for (int i = 0; files!=null && i < files.length; i++) {
                showFile(files[i].getPath());
            }

        }else{
            String filePath = file.getPath();
            System.out.println("普通文件===================" + filePath);
        }
    }
}
